#include<stdio.h>
#include<stdlib.h>

typedef struct{int s; int t;}Node;

#define NUM 50;
Node stack[50];
int stack_p=0;

int push(int start,int end)
{
    if(stack_p < 50)
    {
        stack[stack_p].s=start;
        stack[stack_p].t=end;

        ++stack_p;
        return 1;
    }
    return 0;
}

int pop()
{
    if(stack_p>0)
    {
        --stack_p;
        return 1;
    }
    return 0;
}

Node top()
{
    return stack[stack_p-1];
}

int isNotEmpty()
{
    if(stack_p<=0)
        return 0;
    return 1;
}

void quickSort2(int L[],int low,int high)
{
    push(low,high);

    int start,end,pivotKey;
    Node current;
    while(isNotEmpty())
    {
        current=top();
        pop();
        low=start=current.s;
        high=end=current.t;
        pivotKey=L[start];

        while(start<end)
        {
            while(start<end && L[end]>=pivotKey) --end;
            L[start]=L[end];
            while(start<end && L[start]<=pivotKey)   ++start;
            L[end]=L[start];
        }
        L[start]=pivotKey;

        if(low<start-1) push(low,start-1);
        if(high>start+1) push(start+1,high);
    }
}

int main()
{
    int A[100];
    int n,cnt=0;
    while(scanf("%d",&n) && (char)n!='#' && cnt<100)
    {
        A[cnt++]=n; //此时可以理解为cnt的值为要存储的数的下标
    }

    quickSort2(A,0,cnt-1);

    int i;
    for(i=0;i<cnt;i++)  printf("%d ",A[i]);
}
